package de.fhhof.robot.control;

import java.io.Serializable;

import de.fhhof.robot.control.cmd.concreate.AssemblyState;
import de.fhhof.robot.control.common.CommonConstants;

public abstract class AWorkFlowCommand implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	protected Color color;
	
	protected int completedSmarties;
	
	protected int requiredSmarties;
	
	protected int receivedSmarties;
	
	protected ExecutionState state;
	
	protected IMessage message;
	
	protected AssemblyState assemblyState;
	
	protected String returnPalatePattern;
	protected String currentTrayNo;
		
	public abstract IMessage execute() throws InvalidOperation;
	
	public void setColor(Color color){
		this.color = color;
	}
	
	public void setState(ExecutionState state){
		this.state = state;
	}
	public void setMessage(IMessage msg){
		this.message = msg;
	}

	public void setRequiredSmarties(int requiredSmarties) {
		this.requiredSmarties = requiredSmarties;
	}

	public void setCompletedSmarties(int completedSmarties) {
		this.completedSmarties = completedSmarties;
	}

	public ExecutionState getState() {
		return state;
	}

	public void setAssemblyState(AssemblyState assemblyState) {
		this.assemblyState = assemblyState;
	}
	public void saveAssembly(){
		ApplicationStorage.getAssemblyState().store(this.assemblyState, CommonConstants.STORAGE_FILE_NAME);

	}

	public int getReceivedSmarties() {
		return receivedSmarties;
	}

	public void setReceivedSmarties(int receivedSmarties) {
		this.receivedSmarties = receivedSmarties;
	}



	
	

}
